From df5866e9a04f8ab2faa46d39aedfdbb39b6c0df0 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Tue, 28 Nov 2017 16:00:23 -0700 Subject: [PATCH] add the changes for the latin1 test. --- test_encoding_latin1 | 55 +++++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/test_encoding_latin1 b/test_encoding_latin1 index 5a374510a..360e60e67 100755 --- a/test_encoding_latin1 +++ b/test_encoding_latin1 @@ -11,43 +11,72 @@ trap "rm -fr $TMPDIR" 0 1 2 3 15 errorcount=0 -if locale -a | grep -q en_US.iso88591 ; then +if locale -a | grep -q en_US.iso88591 ; then export LC_ALL=en_US.iso88591 -# test input file name mangling +echo "Running latin1 file name encoding test" +filenamebase=test_encoding_file¢ + +# test input file name mangling with gpsbabel::File + echo "testing input file name with gpsbabel::File" rm -f ${TMPDIR}/test_encoding_file* - cp ${REFERENCE}/bounds-test.gpx ${TMPDIR}/test_encoding_file¢.gpx - ${PNAME} -i gpx -f ${TMPDIR}/test_encoding_file¢.gpx -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { + cp ${REFERENCE}/bounds-test.gpx ${TMPDIR}/${filenamebase}.gpx + ${PNAME} -i gpx -f ${TMPDIR}/${filenamebase}.gpx -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { echo "ERROR: The input file name was mangled." errorcount=`expr $errorcount + 1` } -# test output file name mangling +# test output file name mangling with gpsbabel::File + echo "testing output file name with gpsbabel::File" rm -f ${TMPDIR}/test_encoding_file* - ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o kml -F ${TMPDIR}/test_encoding_file¢.kml - count=$(ls -1 -l ${TMPDIR}/test_encoding_file¢.kml | wc -l) + ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o kml -F ${TMPDIR}/${filenamebase}.kml + count=$(ls -1 -l ${TMPDIR}/${filenamebase}.kml 2>/dev/null | wc -l) if [ $count -lt 1 ]; then echo "ERROR: The output file name was mangled." errorcount=`expr $errorcount + 1` fi -# test output file name mangling using a format that uses gbfile +# test input file name mangling with gbfile stdapi + echo "testing input file name with gbfile stdapi" rm -f ${TMPDIR}/test_encoding_file* - ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o unicsv -F ${TMPDIR}/test_encoding_file¢.csv - count=$(ls -1 -l ${TMPDIR}/test_encoding_file¢.csv | wc -l) + cp ${REFERENCE}/unicsv_subsec.csv ${TMPDIR}/${filenamebase}.csv + ${PNAME} -i unicsv -f ${TMPDIR}/${filenamebase}.csv -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { + echo "ERROR: The input file name was mangled." + errorcount=`expr $errorcount + 1` + } + +# test output file name mangling with gbfile stdapi + echo "testing output file name with gbfile stdapi" + rm -f ${TMPDIR}/test_encoding_file* + ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o unicsv -F ${TMPDIR}/${filenamebase}.csv + count=$(ls -1 -l ${TMPDIR}/${filenamebase}.csv 2>/dev/null | wc -l) if [ $count -lt 1 ]; then echo "ERROR: The output file name was mangled." errorcount=`expr $errorcount + 1` fi -# test input file name mangling using a format that uses gbfile with the gzapi +# test input file name mangling with gbfile gzapi + echo "testing input file name with gbfile gzapi" rm -f ${TMPDIR}/test_encoding_file* - cp ${REFERENCE}/sample.gtm.gz ${TMPDIR}/test_encoding_file¢.gtm.gz - ${PNAME} -i gtm -f ${TMPDIR}/test_encoding_file¢.gtm.gz -o gpx -F ${TMPDIR}/test_encoding_fileo.gpx || { + cp ${REFERENCE}/sample.gtm.gz ${TMPDIR}/${filenamebase}.gtm.gz + ${PNAME} -i gtm -f ${TMPDIR}/${filenamebase}.gtm.gz -o kml -F ${TMPDIR}/test_encoding_fileo.kml || { echo "ERROR: The input file name was mangled." errorcount=`expr $errorcount + 1` } +# test output file name mangling with gbfile gzapi + echo "testing output file name with gbfile gzapi" + rm -f ${TMPDIR}/test_encoding_file* + ${PNAME} -i gpx -f ${REFERENCE}/bounds-test.gpx -o gtm -F ${TMPDIR}/${filenamebase}.gtm.gz + count=$(ls -1 -l ${TMPDIR}/${filenamebase}.gtm.gz 2>/dev/null | wc -l) + if [ $count -lt 1 ]; then + echo "ERROR: The output file name was mangled." + errorcount=`expr $errorcount + 1` + fi + +# TODO: add tests to cover formats that use other open methods. +# for example shape files. + else echo "$0 cannot run without the en_US.iso88591 locale." fi -- 2.30.2